// Copyright © 2016 Zlatko Čalušić
//
// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file.

package gsi

import (
	"github.com/shirou/gopsutil/v3/mem"
)

// Memory information.
type Memory struct {
	Total uint64 `json:"total"`
}

func (info *Memory) getMemoryInfo() {
	v, err := mem.VirtualMemory()
	if err != nil {
		return
	}
	info.Total = v.Total
}

func (i *Memory) YAMLString() string {
	return SafeYAML(i)
}

func (i *Memory) JSONString(indent bool) string {
	return SafeJSON(i, indent)
}
